import sys
import os
CODE_INTERNAL_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '.')) # 生成Code文件夹内部对应的绝对路径
sys.path.append(CODE_INTERNAL_PATH)

from Code.utils.lstm import normalization, anit_normalization
from keras.models import load_model

model = load_model("./Code/transformer/model/follow_EPOCHS_50_BATCH_SIZE_64_transformer-normalization.keras")

input_data = [[ 3.780490e+00,  3.819140e+00, -1.250760e+00,  6.923900e-01,  1.345953e+01],
 [ 3.626130e+00,  3.839580e+00, -1.543670e+00,  2.043300e-01,  1.344693e+01],
 [ 3.449030e+00,  3.823400e+00, -1.770960e+00, -1.618300e-01,  1.341753e+01],
 [ 3.255760e+00,  3.781350e+00, -1.932630e+00, -4.204900e-01,  1.337253e+01],
 [ 3.052900e+00,  3.722740e+00, -2.028670e+00, -5.860500e-01,  1.331277e+01],
 [ 2.846990e+00,  3.655450e+00, -2.059090e+00, -6.728900e-01,  1.323885e+01],
 [ 2.644600e+00,  3.585910e+00, -2.023890e+00, -6.954200e-01,  1.315136e+01],
 [ 2.452290e+00,  3.519110e+00, -1.923060e+00, -6.680300e-01,  1.305096e+01],
 [ 2.276630e+00,  3.458600e+00, -1.756610e+00, -6.051200e-01,  1.293851e+01],
 [ 2.124010e+00,  3.406490e+00, -1.526190e+00, -5.210900e-01,  1.281529e+01],
 [ 2.000570e+00,  3.363460e+00, -1.234410e+00, -4.303200e-01,  1.268303e+01],
 [ 1.913880e+00,  3.324210e+00, -8.668600e-01, -3.924200e-01,  1.254436e+01],
 [ 1.869160e+00,  3.282080e+00, -4.471900e-01, -4.213500e-01,  1.240321e+01],
 [ 1.860330e+00,  3.231480e+00, -8.832000e-02, -5.059500e-01,  1.226400e+01],
 [ 1.870800e+00,  3.167870e+00,  1.046900e-01, -6.360800e-01,  1.213058e+01],
 [ 1.893790e+00,  3.071890e+00,  2.298900e-01, -9.598400e-01,  1.200682e+01],
 [ 1.921400e+00,  2.939800e+00,  2.761300e-01, -1.320910e+00,  1.189700e+01],
 [ 1.944620e+00,  2.783850e+00,  2.322400e-01, -1.559440e+00,  1.180412e+01],
 [ 1.953330e+00,  2.615600e+00,  8.707000e-02, -1.682540e+00,  1.172904e+01],
 [ 1.953440e+00,  2.437090e+00,  1.060000e-03, -1.785060e+00,  1.167175e+01],
 [ 1.952470e+00,  2.249540e+00, -9.710000e-03, -1.875530e+00,  1.163271e+01],
 [ 1.952370e+00,  2.065960e+00, -9.500000e-04, -1.835810e+00,  1.161219e+01],
 [ 1.953400e+00,  1.906690e+00,  1.031000e-02, -1.592710e+00,  1.160883e+01],
 [ 1.956290e+00,  1.781010e+00,  2.882000e-02, -1.256760e+00,  1.161994e+01],
 [ 1.959200e+00,  1.679760e+00,  2.915000e-02, -1.012520e+00,  1.164267e+01],
 [ 1.957830e+00,  1.589910e+00, -1.368000e-02, -8.985500e-01,  1.167504e+01],
 [ 1.949340e+00,  1.506000e+00, -8.491000e-02, -8.391000e-01,  1.171560e+01],
 [ 1.936210e+00,  1.431600e+00, -1.313000e-01, -7.440000e-01,  1.176300e+01],
 [ 1.924540e+00,  1.381440e+00, -1.166500e-01, -5.016200e-01,  1.181539e+01],
 [ 1.919260e+00,  1.367220e+00, -5.283000e-02, -1.422000e-01,  1.187014e+01]]

normalized, min_max_list = normalization([input_data], [0, 1, 2, 3, 4], [True, True, False, False, True])
print("normalized", normalized)
print("min_max_list", min_max_list)

predict_data = model(normalized)
print("predict_data", predict_data)

anti_predict_data = anit_normalization(predict_data, [0], [min_max_list[1]], [False])